home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / Softshoe / Lisa's Mac Parts / Views / Canvas Loops / CanvasColumnLoop.cp next >
Text File  |  2000-06-23  |  747b  |  38 lines

  1. // CanvasColumnLoop.cp
  2.  
  3. #ifndef CanvasColumnLoop_h
  4. #include "CanvasColumnLoop.h"
  5. #endif
  6.  
  7. CanvasColumnLoop::CanvasColumnLoop( const Canvas& theParent,
  8.                                                 Range32 firstColumn )
  9.   : parent( theParent ),
  10.      canvas( theParent ),
  11.      column( firstColumn )
  12.   {
  13.     if ( Unfinished() )
  14.       {
  15.         canvas.SliceVertically( column );
  16.         canvasMaintainer.Use( canvas );
  17.       }
  18.      else
  19.         canvasMaintainer.UseNone();
  20.   }
  21.  
  22. void CanvasColumnLoop::NextColumn( uint32 width )
  23.   {
  24.     Assert( Unfinished() );
  25.  
  26.     Assert( width <= maxint32 - column.End() );
  27.     column = Range32( column.End(), column.End() + width );
  28.  
  29.     if ( Unfinished() )
  30.       {
  31.         canvas = parent;
  32.         canvas.SliceVertically( column );
  33.         canvasMaintainer.Use( canvas );
  34.       }
  35.      else
  36.         canvasMaintainer.UseNone();
  37.   }
  38.